//
//  GCHUDLayer.m
//  GalaxyConqueror
//
//  Created by Test on 8/3/14.
//  Copyright (c) 2014 Stefan.Nestorov. All rights reserved.
//

#import "GCHUDLayer.h"

@implementation GCHUDLayer

-(instancetype)init
{
    
    self = [super init];
    if ( self ) {
        
        CGRect winSize = [UIScreen mainScreen].bounds;
        
        SKLabelNode * points = [[SKLabelNode alloc] init];
        [points setPosition:CGPointMake( winSize.size.height / 2 ,winSize.size.width - 30)]; //width because its landscape
        [points setText:@"1000"];
        
        [self addChild:points];
        
        _shootButton = [self fireButtonNode];
        [self addChild:_shootButton];
        
    }
    
    return self;
    
}

//fire button
- (SKSpriteNode *)fireButtonNode
{
    
    SKTextureAtlas *spritesAtlas = [GCGlobals textureAtlasNamed:@"sprites"];
    SKSpriteNode *fireNode = [[SKSpriteNode alloc] initWithTexture:[spritesAtlas textureNamed:@"mole_1"]];
    
    [fireNode setScale:0.5];
    fireNode.position = CGPointMake(500, fireNode.size.height / 2);
    fireNode.name = @"fireButtonNode";//how the node is identified later
    fireNode.zPosition = 1.0;
    
    return fireNode;
}

@end
